<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateNodesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('nodes', function (Blueprint $table) {
            $table->id();
           $table->string('name',50)->comment('节点名称');
           $table->string('route_name',50)->default('')->comment('路由别名，权限标识');
          $table->unsignedInteger('pid')->default(0)->comment('上级id');
          $table->enum('is_menu',['0','1'])->default('0')
              ->comment('是否是菜单，0不是，1是');
          $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('nodes');
    }
}
